#!/bin/bash

#make cmd
scan_dir() {
  for file in $(find "${1}" -name '*.proto'); do
    if [ -d "$file" ]; then
      scan_dir "${file}"
    else
      protoc -I .. -I . -I "${GOPATH}"/pkg/mod --gofast_out=.. --micro_out=.. ./"${file}"
      echo "${file}"
    fi
  done
}

scan_dir "common/proto"
